import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入自己封装的rem设置
//import './assets/js/setRem'

//引入字体图标
import './assets/fonts/iconfont.css'
//引入flexible
import 'lib-flexible'

import axios from 'axios'
import './assets/css/base.css'
import { Tabbar, TabbarItem, Icon, Swipe,  SwipeItem,  SwipeCell, Loading, PullRefresh, Grid, GridItem, GoodsAction, GoodsActionIcon, GoodsActionButton, Button, Popup, Card, Sidebar,Stepper, SubmitBar, Search, ContactCard, ContactList, ContactEdit, AddressList, AddressEdit, Checkbox, CheckboxGroup, Lazyload } from 'vant'

//const img = require(./assets/img/loading.gif) 
//通过这样的方式可以实现在assets中实现图片的懒加载

Vue.use(Tabbar)
  .use(TabbarItem)
  .use(Icon)
  .use(Swipe)
  .use(SwipeItem)
  .use(SwipeCell)
  .use(Loading)
  .use(PullRefresh)
  .use(Grid)
  .use(GridItem)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Button)
  .use(Popup)
  .use(Card)
  .use(ContactCard)
  .use(ContactList)
  .use(ContactEdit)
  .use(AddressList)
  .use(AddressEdit)
  .use(Stepper)
  .use(SubmitBar)
  .use(Search)
  .use(Sidebar)
  .use(Checkbox)
  .use(CheckboxGroup)

//vue的图片懒加载
Vue.use(Lazyload, {
  preload: '100%',
  loading: './loading.gif'//npm run build之后 assets不会生成
})

Vue.prototype.$http = axios
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
